<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<link type="text/css" rel="stylesheet" href="__PUBLIC__/css/style.css" />
    <!--[if IE 6]>
    <script src="js/iepng.js" type="text/javascript"></script>
        <script type="text/javascript">
           EvPNG.fix('div, ul, img, li, input, a'); 
        </script>
    <![endif]-->
    <script type="text/javascript" src="__PUBLIC__/address/js/jquery-1.11.0.min.js"></script>
<title>尤洪</title>

  <style>
      #eidt{
        border:1px solid red;
        width: 500px;
        height: 240px;
        position:fixed;
        background:white;
        left:50%;
        top:50%;
        display:none
      }
  </style>
</head>
<body>  
<!--Begin Header Begin-->
<include file="./Public/file/top.html" />
<!--End Header End--> 
<div class="i_bg bg_color">
    <!--Begin 用户中心 Begin -->
	<div class="m_content">
   		<include file="./Zxshop/Home/View/Member/left.html" />
		<div class="m_right">
            <div class="mem_tit">收货地址</div>

        <foreach name="list" item="val">
              <div class="address">
              <div class="a_close"><a href="#"><img src="__PUBLIC__/images/a_close.png" /></a></div>
              <table border="0" class="add_t" align="center" style="width:98%; margin:10px auto;" cellspacing="0" cellpadding="0" id="table">
                  <tr>
                    <td align="right" width="80">收货人姓名：</td>
                    <td>{$val['linkman']}</td>
                  </tr>
                  <tr>
                    <td align="right">详细地址：</td>
                    <td>{$val['address']}</td>
                  </tr>
                  <tr>
                    <td align="right">手机：</td>
                    <td>{$val['phone']}</td>
                  </tr>
                  <tr>
                    <td align="right">邮编：</td>
                    <td>{$val['code']}</td>
                  </tr>
                  <input type="hidden" value="{$val['id']}">
                  <input type="hidden" value="{$val['uid']}">
                </table>
                <p align="right" id="p{$val['id']}">
                  <a href="#" style="color:#ff4e00;">设为默认</a>　
                  <a href="javascript:void(0)" style="color:#ff4e00;">编辑</a>
                </p>
            </div>
        </foreach>
        
        <div id="eidt" >
          <form action="{:U('Home/member/member_eidt')}" method="post">
            <table style="margin-top: 30px">
                <tr>
                  <td>收货人姓名：</td>
                  <td><input type="text" name="linkman"></td>
                </tr>
                <tr>
                  <td>详细地址：</td>
                  <td><input type="text" name="address"></td>
                </tr>
                <tr>
                  <td>手机：</td>
                  <td><input type="text" name="phone"></td>
                </tr>
                <tr>
                  <td>邮编：</td>
                  <td><input type="text" name="code"></td>
                </tr>
            </table>
            <input type="submit" value="保存" style="margin-left: 150px">
            <input id="cancel" type="button" value="取消">
            <input type="hidden" name="id" id="aid">
            <input type="hidden" name="uid" id="uid">
          </form>
        </div>
        <script>
          $(p{$val['id']}).children().eq(1).click(function(){
              $('<div id="blank"></div>').css({
                'width':$(window).width(),
                'height':$(window).height(),
                'background':'rgba(0,0,0,0.3)',
                'position':'fixed',
                'left':0,
                'top':0,
              }).appendTo($(document.body));
              init();
          });

          function init(){
            $('#eidt').css({
              'margin-left':function(){
                return -(Math.ceil($(this).width() / 2));
              },
              'margin-top':function(){
                return -(Math.ceil($(this).height() / 2));
              },
              'display':'block',
            }).appendTo($(document.body));

            var v1 = $('#table td').eq(1).text();
            var v2 = $('#table td').eq(5).text();
            var v3 = $('#table td').eq(7).text();
            var v4 = $('#table td').eq(9).text();
            var v5 = $('#table input:hidden').eq(0).val();
            var v6 = $('#table input:hidden').eq(1).val()
            // alert(v6);
            
            $('#eidt table td input:eq(0)').val(v1);
            $('#eidt table td input:eq(1)').val(v2);
            $('#eidt table td input:eq(2)').val(v3);
            $('#eidt table td input:eq(3)').val(v4);
            $('#aid').val(v5);
            $('#uid').val(v6);
          }

          // alert("$(p{$val['id']})");
          $('#cancel').click(function(){
              $('#eidt').css('display','none');
              $('#blank').remove();
          });

          </script>

            <div class="mem_tit">
            	<a href="#"><img src="__PUBLIC__/images/add_ad.gif" /></a>
            </div>
            <table border="0" class="add_tab" style="width:930px;"  cellspacing="0" cellpadding="0">
              <!-- <tr>
                <td width="135" align="right">配送地区</td>
                <td colspan="3" style="font-family:'宋体';">
                   <div id="distpicker2" name="address">
                    <select id="province" name="province"></select>
                    <select id="city" name="city"></select>
                    <select id="county" name="county"></select>
                  </div>
                </td>
              </tr> -->
              <tr>
                <td align="right">收货人姓名</td>
                <td style="font-family:'宋体';"><input type="text" value="姓名" class="add_ipt" />（必填）</td>
                <td align="right">电子邮箱</td>
                <td style="font-family:'宋体';"><input type="text" value="12345678@qq.com" class="add_ipt" />（必填）</td>
              </tr>
              <tr>
                <td align="right">详细地址</td>
                <td style="font-family:'宋体';"><input type="text" value="世外桃源" class="add_ipt" />（必填）</td>
                <td align="right">邮政编码</td>
                <td style="font-family:'宋体';"><input type="text" value="610000" class="add_ipt" /></td>
              </tr>
              <tr>
                <td align="right">手机</td>
                <td style="font-family:'宋体';"><input type="text" value="1361234587" class="add_ipt" />（必填）</td>
                <td align="right">电话</td>
                <td style="font-family:'宋体';"><input type="text" value="028-12345678" class="add_ipt" /></td>
              </tr>
            </table>
           	<p align="right">
            	<a href="#">删除</a>&nbsp; &nbsp; <a href="#" class="add_b">确认修改</a>
            </p>
        </div>
    </div>
	<!--End 用户中心 End--> 
    <!--Begin Footer Begin -->
    <include file="./Public/file/bottom.html" />
    <!--End Footer End -->    
</div>
  
</body>

<script src="__PUBLIC__/js/bootstrap.min.js"></script>
<script src="__PUBLIC__/address/js/distpicker.data.js"></script>
<script src="__PUBLIC__/address/js/distpicker.js"></script>
<script src="__PUBLIC__/address/js/main.js"></script>
<script>
  $("#distpicker2").distpicker();

  // $('#p1').children().eq(1).click(function(){
  //     $(this).text('保存');
  //     var v = $('tr td').eq(1).text();
  //     $('tr td').eq(1).html('<input type="text" id="myText" value='+v+'>');
  //     var v1 = $('input#myText').val();


  //     $('tr td').eq(3).html('<div id="distpicker1"><select></select>　<select></select>　<select></select></div>');
      $("#distpicker1").distpicker();

  //     var v = $('tr td').eq(5).text();
  //     $('tr td').eq(5).html('<input type="text" size="30" value='+v+'>');
  //     var v = $('tr td').eq(7).text();
  //     $('tr td').eq(7).html('<input type="text" size="30" value='+v+'>');
  //     var v = $('tr td').eq(9).text();
  //     $('tr td').eq(9).html('<input type="text" size="30" value='+v+'>');
  //     var v = $('tr td').eq(11).text();
  //     $('tr td').eq(11).html('<input type="text" size="30" value='+v+'>');
  //     var v = $('tr td').eq(13).text();
  //     $('tr td').eq(13).html('<input type="text" size="30" value='+v+'>');


  //     $(this).click(function(){
  //       // $('tr td').eq(1).text(v1);
  //       alert(v1);
  //     })
  // });

</script>
<!--[if IE 6]>
<script src="//letskillie6.googlecode.com/svn/trunk/2/zh_CN.js"></script>
<![endif]-->
</html>
